import Layout from '@/views/Layout.vue'
import type { RouteRecordRaw } from 'vue-router'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    redirect: '/meetingRoomManage',
    children: [
      {
        path: '/meetingRoomManage',
        name: 'meetingRoomManage',
        meta: {
          title: '会议室管理',
          isShowMenu: true
        },
        component: () => import('../views/meetingRoomManage/index.vue')
      },
      {
        path: '/bookingHistory',
        name: 'bookingHistory',
        meta: {
          title: '预定历史',
          isShowMenu: true
        },
        component: () => import('../views/bookingHistory/index.vue')
      }
    ]
  },
  {
    path: '/updateUserInfo',
    name: 'updateUserInfo',
    meta: {
      title: '用户信息修改',
      isShowMenu: false
    },
    component: () => import('../views/updateUserInfo/UpdateUserInfo.vue')
  },
  {
    path: '/updatePassword',
    name: 'updatePassword',
    meta: {
      title: '用户密码修改',
      isShowMenu: false
    },
    component: () => import('../views/updatePassword/UpdatePassword.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register/Register.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/Login.vue')
  },

  // 配置 errorPage
  {
    path: '/:pathMatch(.*)*',
    name: 'errorPage',
    component: () => import('../views/ErrorPage.vue')
  }
]
